package com.test.demo.entity;

import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
/**
 * @author: liangruichao
 * @date: 2022-08-18 16:17
 **/

@Entity
@Data
public class Devices {



    //@Id 标注用于声明一个实体类的属性映射为数据库的主键列。该属性通常置于属性声明语句之前，可与声明语句同行，也可写在单独行上。
    //@Id标注也可置于属性的getter方法之前。
    //
    //@GeneratedValue：
    //@GeneratedValue 用于标注主键的生成策略，通过strategy 属性指定。
    // 默认情况下，JPA 自动选择一个最适合底层数据库的主键生成策略：SqlServer对应identity，MySQL 对应 auto increment。
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;
    private String fan_no;
    private String call_time;
    private int call_count;

    public void setId(int id) {
        this.id = id;
    }

    public void setFan_no(String fan_no) {
        this.fan_no = fan_no;
    }

    public void setCall_time(String call_time) {
        this.call_time = call_time;
    }

    public void setCall_count(int call_count) {
        this.call_count = call_count;
    }

    public String getFan_no() {
        return fan_no;
    }

    public int getCall_count() {
        return call_count;
    }

    public String getCall_time() {
        return call_time;
    }

    public int getId() {
        return id;
    }

    @Override
    public String toString() {
        return "Devices{ " +
                "id = " + id +
                ", fan_no = '" + fan_no + '\'' +
                ", call_time = '" + call_time + '\'' +
                ", call_count = '" + call_count +
                "}";
    }

}
